package com.xxx.system.service.impl;

import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.SecureUtil;
import com.github.pagehelper.PageHelper;
import com.xxx.system.domain.Dict;
import com.xxx.system.mapper.DictMapper;
import com.xxx.system.query.DictQuery;
import com.xxx.system.service.IDictService;
import com.xxx.user.domain.User;
import com.xxx.user.mapper.UserMapper;
import com.xxx.user.query.UserQuery;
import com.xxx.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author BoWei Wang
 * @date 2025/8/5
 */
@Service
public class DictServiceImpl implements IDictService {
    @Autowired
    private DictMapper dictMapper;

    @Override
    public List<Dict> findAll() {
        return dictMapper.findAll();
    }

    @Override
    public Dict findOne(Long id) {
        return dictMapper.findOne(id);
    }

    @Override
    public List<Dict> queryPage(DictQuery dictQuery) {
        PageHelper.startPage(dictQuery.getCurrentPage(), dictQuery.getPageSize());
        return dictMapper.queryPage(dictQuery);
    }

    @Override
    public void addDict(Dict dict) {
        dictMapper.addDict(dict);
    }

    @Override
    public void updateDict(Dict dict) {
        dictMapper.updateDict(dict);
    }

    @Override
    public void deleteDict(Long id) {
        dictMapper.deleteDict(id);
    }

    @Override
    public void batchDeleteDicts(Long[] ids) {
        dictMapper.batchDeleteDicts(ids);
    }
}
